<?php 
class Customer extends TRecord
{ 
    const ...
    private $category;

    public function setCategory(Category $category) 
    { 
        $this->category = $category; 
        $this->category_id = $category_id; 
    }
    
    public function getCategory() 
    { 
        if (empty($this->category)) 
        { 
            $this->category = new Category($this->category_id); 
        }
        return $this->category; 
    }
?>
